package org.onion.pattern.sample.order.doamin.pay.event;

import lombok.Data;
import org.onion.pattern.event.domain.DomainEvent;
import org.onion.pattern.event.domain.annotation.ExternalEvent;
import org.onion.pattern.event.domain.enums.PublishMode;
import org.onion.pattern.event.spring.external.rocketmq.annotation.RocketmqEvent;
import org.onion.pattern.sample.order.doamin.pay.PayOrder;

import java.time.LocalDateTime;
import java.util.UUID;

@Data
@RocketmqEvent("PayEvent")
@ExternalEvent(value = "PAY", publishMode = PublishMode.OUTBOX)
public class PayRefundEvent implements DomainEvent<Long> {

    private PayOrder order;

    @Override
    public String eventKey() {
        return UUID.randomUUID().toString();
    }

    @Override
    public LocalDateTime eventTime() {
        return LocalDateTime.now();
    }

    @Override
    public Long domainId() {
        return 1L;
    }

}
